import React, { useEffect, useState } from "react";
import GridWrapper from "../gridWrapper";
import MapChart from "../../../../components/charts/other/mapChart";
import { message, notification } from "antd";

import getDataApi from "utils/api/defaultApi";

import "assets/less/components/charts/billChart.less";

// 布局位置
const layouts = {
  lg: [
    { i: "a", x: 0, y: 0, w: 24, h: 21, minH: 10, minW: 8 },
  ],
  md: [
    { i: "a", x: 2, y: 0, w: 20, h: 21, minH: 9, minW: 8 },
  ],
  sm: [
    { i: "a", x: 0, y: 0, w: 12, h: 21, minH: 9, minW: 6 },
  ]
};

const HIVChart = () => {
  const [data, setData] = useState([]);

  useEffect(() => {
    getDataApi("/other/sars")
      .then(res => {
         setData(res)
      })
      .catch(err => {
        console.log(err);
      });
  }, []);

  return (
    <GridWrapper className="computer-chart" layouts={layouts}>
      <MapChart data={data} title="新型冠状病毒" name="新型冠状病毒传染分布" />
    </GridWrapper>
  );
};

export default HIVChart;
